package com.zjc.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * Created by lv_03575 on 2018/4/18.
 */
public class BaseActiviti {

    ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine();
    public BaseActiviti(){
        System.out.println("默认父类构造");
    }

    public  void baseDeploy(String file){
        //部署路程定义
        RepositoryService repositoryService=processEngine.getRepositoryService();//获取repositoryService 对象
        Deployment deployment=repositoryService.createDeployment()//创建一个部署对象
                .name(file)//添加部署名称
                .addClasspathResource(file)//加载资源文件
                .deploy();//
        //打印我们的流程信息
        System.out.println("--------部署Id:"+deployment.getId());
        System.out.println("--------部署Name:"+deployment.getName());
    }
}
